

    Singleton.implementStatic 
    (

        /*
         * implementStatic works in just the same way as #implement, the difference
         * being that properties are added to the constructor directly, as opposed
         * to the constructors prototype.
         */
        function getInstance () 
        {
            if (this.is(this.instance))
                return this.instance;
                
            return this.instance= new this;
        }
    );
    
    function Singleton () 
    {
        if (this.constructor.instance)
            throw new Error ('Singleton instantiation error');
    };
    
    // its worth noting that in terms of methods applied to a constructor,
    // the keyword this refers to the constructor. The above getInstance
    // method could be rewritten in more conventional terms, like so
    
    Singleton.implementStatic
    (
    
        function getInstance () 
        {
            if (false === Singleton.is(Singleton.instance))
               Singleton.instance= new Singleton;
                
            return Singleton.instance;
        }
    );
    
    // the thing is, if we elect for static inheritance, the first implementation
    // will refer to the subclasses constructor just fine, while the second
    // implementation will insist on returning an instance of Singleton, and
    // not ServiceLocator
    
    
    ServiceLocator.inherit(Singleton, true); // inherits prototype AND static
    function ServiceLocator () 
    {
        Singleton.call(this);
    };
    
